package com.example.mapper;

import com.example.entity.AdminNotice;
import com.mysql.cj.protocol.x.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface NoticeMapper {
    @Select("select * from notice order by id desc")
    List<AdminNotice> getAll(AdminNotice notice);
    @Insert("insert into notice (content,time) value (#{content},#{time})")
    void add(AdminNotice notice);
    @Update("UPDATE notice SET content = #{content}, time = #{time} WHERE id = #{id}")
    void update(AdminNotice notice);
    @Delete("DELETE from notice where id =#{id}")
    void deleteById(Integer id);
}
